import logging
import threading
import time

import pendulum
import pytest
from tools.decorators import log_decorator
from DrissionPage import ChromiumPage, ChromiumOptions
from tools.page import page_get
from 数据抓取.分发 import 分发
from 数据抓取.快递单号获取 import 快递单号获取
from 数据抓取.收货地址获取 import 收货地址获取
from 数据抓取.聚水潭获取 import 聚水潭获取

date = pendulum.now().subtract(days=20).strftime('%Y-%m-%d')


@pytest.mark.run(order=1)
@log_decorator
def 快递单号获取_test(login_聚水潭):
    快递单号获取(date)


@pytest.mark.run(order=2)
@log_decorator
@pytest.mark.flaky(reruns=10, reruns_delay=2, reruns_show_all=True)
def 聚水潭获取_test():
    聚水潭获取(date)


@pytest.mark.run(order=3)
@log_decorator
@pytest.mark.flaky(reruns=50, reruns_delay=2, reruns_show_all=True)
def 收货地址获取_test():
    收货地址获取(date)


@pytest.mark.run(order=4)
@log_decorator
def 分发_test():
    分发(date)
